package com.ctshk.rpc.order.tour.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.ctshk.rpc.order.tour.code.SeriesOrderTouristQuitRefundStatusCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Objects;

/**
 * <p>
 * 系列团游客信息
 * </p>
 *
 * @author 谭响
 * @since 2021-01-18
 */
@Data
@ApiModel(value="系列团游客信息DTO", description="系列团游客信息DTO")
public class SeriesOrderTouristInfoDTO implements Serializable {

    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "所属订单")
    private Long orderId;

    @ApiModelProperty(value = "团期ID")
    private Long scheduleId;

    @ApiModelProperty(value = "所属组ID")
    private Long groupId;

    @ApiModelProperty(value = "所属房间ID")
    private Long roomId;

    @ApiModelProperty(value = "所属套餐")
    private Long packageId;

    @ApiModelProperty(value = "套餐名称")
    private String packageName;

    @ApiModelProperty(value = "游客类型主数据ID")
    private Long mainDataId;

    @ApiModelProperty(value = "游客类型名称")
    private String touristTypeName;

    @ApiModelProperty(value = "中文姓")
    private String cnSurname;

    @ApiModelProperty(value = "中文姓名")
    private String cnName;

    @ApiModelProperty(value = "英文姓")
    private String enSurname;

    @ApiModelProperty(value = "英文名称")
    private String enName;

    @ApiModelProperty(value = "英文全名")
    private String enFullname;

    @ApiModelProperty(value = "性别（1：先生，2：女士，3：小姐，4：男童，5：女童）")
    private Integer gender;

    @ApiModelProperty(value = "是否完善资料(0 否,1 是)")
    private Integer isFullInfo;

    @ApiModelProperty(value = "国籍")
    private String nation;

    @ApiModelProperty(value = "国籍Id")
    private Long nationId;

    @ApiModelProperty(value = "电话区号")
    private String mobileAreaCode;

    @ApiModelProperty(value = "联系方式")
    private String mobile;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "证件类型1")
    private String certificateType1;

    @ApiModelProperty(value = "证件类型Id1")
    private Long certificateTypeId1;

    @ApiModelProperty(value = "证件号1")
    private String certificateNumber1;

    @ApiModelProperty(value = "证件有效期1")
    private LocalDate certificateValidDate1;

    @ApiModelProperty(value = "证件签发地1")
    private String certificatePlace1;

    @ApiModelProperty(value = "证件签发地Id1")
    private Long certificatePlaceId1;

    @ApiModelProperty(value = "证件类型2")
    private String certificateType2;

    @ApiModelProperty(value = "证件类型Id2")
    private Long certificateTypeId2;

    @ApiModelProperty(value = "证件号2")
    private String certificateNumber2;

    @ApiModelProperty(value = "证件有效期2")
    private LocalDate certificateValidDate2;

    @ApiModelProperty(value = "证件签发地2")
    private String certificatePlace2;

    @ApiModelProperty(value = "证件签发地Id2")
    private Long certificatePlaceId2;

    @ApiModelProperty(value = "证件类型3")
    private String certificateType3;

    @ApiModelProperty(value = "证件类型Id3")
    private Long certificateTypeId3;

    @ApiModelProperty(value = "证件号3")
    private String certificateNumber3;

    @ApiModelProperty(value = "证件有效期3")
    private LocalDate certificateValidDate3;

    @ApiModelProperty(value = "证件签发地3")
    private String certificatePlace3;

    @ApiModelProperty(value = "证件签发地Id3")
    private Long certificatePlaceId3;

    @ApiModelProperty(value = "证件项")
    List<SeriesOrderTouristInfoCertificateDTO> certificateList;

    @ApiModelProperty(value = "紧急联系人姓名")
    private String emergencyContactName;

    @ApiModelProperty(value = "紧急联系人电话区号")
    private String emergencyMobileAreaCode;

    @ApiModelProperty(value = "紧急联系人电话")
    private String emergencyMobile;

    @ApiModelProperty(value = "付款状态（1 待付款 2 待付余款 3 已付全款 4 已退团）")
    private Integer payStatus;

    @ApiModelProperty(value = "退团状态")
    private Integer quitRefundStatus;

    @ApiModelProperty(value = "NoShow")
    @TableField("noShow")
    private Integer noshow;

    @ApiModelProperty(value = "渠道来源主数据ID")
    private Long channelId;

    @ApiModelProperty(value = "锁定状态")
    private Integer lockStatus;

    @ApiModelProperty(value = "创建人")
    private Long createId;

    @ApiModelProperty(value = "修改人")
    private Long modifiedId;

    @ApiModelProperty(value = "删除标识")
    private Integer isDeleted;

    @ApiModelProperty(value = "出生日期")
    private LocalDate birthday;

    @ApiModelProperty(value = "应收")
    private BigDecimal totalReceivables;

    @ApiModelProperty(value = "实收")
    private BigDecimal totalPaidIn;

    @ApiModelProperty(value = "未收")
    private BigDecimal remainingReceivables;

    //狀態：取【收款管理】的狀態，退團狀態優先收款狀態
    public Integer getPayStatus() {
        if (Objects.equals(this.quitRefundStatus, SeriesOrderTouristQuitRefundStatusCode.ALREADY.getCode())) {
            this.payStatus = SeriesOrderTouristQuitRefundStatusCode.ALREADY.getCode();
        }
        return payStatus;
    }

}
